#pragma once
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

typedef int BTtreedate;

typedef struct binarytree
{
	BTtreedate val;
	struct binarytree* left;
	struct binarytree* right;
}BTNode;

BTNode* BTbuynode(BTtreedate x)
{
	BTNode* newNode = (BTNode*)malloc(sizeof(BTNode));
	if (newNode == NULL)
	{
		perror("malloc is faild");
		return NULL;
	}
	newNode->val = x;
	newNode->right = newNode->left = NULL;
	return newNode;
}

int treedeep(BTNode* root);
int treeleafsize(BTNode* root);
int treesize(BTNode* root);
int treesizek(BTNode* root, int k);